﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.ObjectPool;
using Newtonsoft.Json;
using System.Buffers;
using System.Text;
using Microsoft.AspNetCore.Mvc.Formatters;

namespace Hpt.Device.Sample.Commom;

public class HptJsonPatchInputFormatter : NewtonsoftJsonInputFormatter
{
    public HptJsonPatchInputFormatter(ILogger logger, JsonSerializerSettings serializerSettings, ArrayPool<char> charPool, ObjectPoolProvider objectPoolProvider, MvcOptions options, MvcNewtonsoftJsonOptions jsonOptions) : base(logger, serializerSettings, charPool, objectPoolProvider, options, jsonOptions)
    {
        SupportedEncodings.Add(Encoding.GetEncoding("GB2312"));
    }
}